import React, { memo, useEffect, useState } from "react";
import { fetchDate } from "../request/data";
const Ceshi = memo(() => {
  const [score, setScore] = useState();
  const [obj, setObj] = useState();
  useEffect(async () => {
    const aa = await fetchDate();
    setObj(aa);
    const score = aa?.operatorExtObject?.matchInfo?.attributes?.tel_score;
    setScore(score);
  }, []);
  console.log(obj);
  console.log(score);
  return (
    <div>
      {(obj?.operatorExtObject?.matchInfo?.attributes?.tel_score ||
        obj?.operatorExtObject?.matchInfo?.attributes?.tel_score === 0) && (
        <div>
          tel_abc_ceshi:
          {obj?.operatorExtObject?.matchInfo?.attributes?.tel_score}
        </div>
      )}
    </div>
  );
});

export default Ceshi;
